package com.jwsoft.manager.core.gateway.controller;

import com.bifang.assistant.common.constants.Validators;
import com.bifang.engine.assistant.core.domain.AppResponse;
import com.bifang.engine.protect.core.annotation.Idempotent;
import com.github.pagehelper.PageInfo;
import com.jwsoft.manager.common.vo.eduBigscreenFiveyearGt.EduBigscreenFiveyearGtKeyVO;
import com.jwsoft.manager.common.vo.eduBigscreenFiveyearGt.EduBigscreenFiveyearGtQueryVO;
import com.jwsoft.manager.common.vo.eduBigscreenFiveyearGt.EduBigscreenFiveyearGtVO;
import com.jwsoft.manager.core.integration.EduBigscreenFiveyearGtIntegration;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 近5年增长趋势表网关
 *
 * @author chenzh
 * @since 2023-02-09
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "近5年增长趋势表", description = "近5年增长趋势表")
public class EduBigscreenFiveyearGtController {

    @Autowired
    public EduBigscreenFiveyearGtIntegration eduBigscreenFiveyearGtIntegration;

    @Operation(summary = "近5年增长趋势表分页查询",description = "近5年增长趋势表分页查询")
    @PostMapping(value = "/bigscreen_fiveyear_gt0001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduBigscreenFiveyearGtVO>> getList(@RequestBody @Validated EduBigscreenFiveyearGtQueryVO vo) {
        return AppResponse.successData(eduBigscreenFiveyearGtIntegration.getList(vo));
    }

    @Operation(summary = "近5年增长趋势表根据主键查询详情",description = "近5年增长趋势表根据主键查询详情")
    @PostMapping(value = "/bigscreen_fiveyear_gt0002", produces = "application/json;charset=UTF-8")
    public AppResponse<EduBigscreenFiveyearGtVO> getById(@RequestBody @Validated EduBigscreenFiveyearGtKeyVO vo) {
        return AppResponse.successData(eduBigscreenFiveyearGtIntegration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "近5年增长趋势表新增",description = "近5年增长趋势表新增")
    @PostMapping(value = "/bigscreen_fiveyear_gt0004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduBigscreenFiveyearGtVO> add(@RequestBody @Validated(value = {Validators.Add.class}) EduBigscreenFiveyearGtVO vo) {
        return AppResponse.successData(eduBigscreenFiveyearGtIntegration.add(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "近5年增长趋势表修改",description = "近5年增长趋势表修改")
    @PostMapping(value = "/bigscreen_fiveyear_gt0005", produces = "application/json;charset=UTF-8")
    public AppResponse<EduBigscreenFiveyearGtVO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) EduBigscreenFiveyearGtVO vo) {
        return AppResponse.successData(eduBigscreenFiveyearGtIntegration.edit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "近5年增长趋势表删除",description = "近5年增长趋势表删除")
    @PostMapping(value = "/bigscreen_fiveyear_gt0006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EduBigscreenFiveyearGtKeyVO vo) {
        eduBigscreenFiveyearGtIntegration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }
}
